<?php
/**
 * Created by PhpStorm.
 * User: tandunzhao
 * Date: 2018/5/30
 * Time: 下午2:36
 */

namespace App\Http\Controllers\Api\Pay\Transformers;


class PayWithdrawCashTransformer
{

    public function transform($obj){
        return [
            'id' => $obj->id,
            'amount' => (float)($obj->amount),
            'tallage' => (float)($obj->tallage),
            'pay_amount' => (float)($obj->amount - $obj->tallage),
            'status'   =>  $obj->status,
            'remark'   =>  $obj->remark,
            'check_user_id'   =>  $obj->check_user_id,
            'created_time'   =>  isset($obj->created_at) ? ($obj->created_at ? date('Y-m-d H:i:s', strtotime($obj->created_at)) : "") : "",
            'updated_time'   =>  isset($obj->updated_at) ? ($obj->updated_at ? date('Y-m-d H:i:s', strtotime($obj->updated_at)) : "") : "",
        ];
    }
}